<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Using Cygwin/X</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"/><LINK
REL="HOME"
TITLE="Cygwin/X User's Guide"
HREF="cygwin-x-ug.html"/><LINK
REL="PREVIOUS"
TITLE="Setting Up Cygwin/X"
HREF="setup.html"/><LINK
REL="NEXT"
TITLE="Displaying local clients"
HREF="using-local-apps.html"/><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html;charset=utf-8"/></HEAD
><BODY
CLASS="chapter"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Cygwin/X User's Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="setup.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="using-local-apps.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"/></DIV
><DIV
CLASS="chapter"
><H1
><A
NAME="using"
></A
>Chapter 3. Using Cygwin/X</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="using.html#using-starting"
>Starting Cygwin/X</A
></DT
><DT
><A
HREF="using-local-apps.html"
>Displaying local clients</A
></DT
><DT
><A
HREF="using-switching.html"
>Switching out of Cygwin/X</A
></DT
><DT
><A
HREF="using-stopping.html"
>Stopping Cygwin/X</A
></DT
><DT
><A
HREF="using-window-managers.html"
>Window managers</A
></DT
><DT
><A
HREF="using-clipboard-integration.html"
>Windows Clipboard integration</A
></DT
><DT
><A
HREF="using-shared-memory.html"
>Shared memory support</A
></DT
><DT
><A
HREF="using-remote-apps.html"
>Displaying remote clients</A
></DT
><DT
><A
HREF="using-remote-session.html"
>Remote sessions via XDMCP</A
></DT
><DT
><A
HREF="using-glx.html"
>OpenGL (GLX)</A
></DT
><DT
><A
HREF="using-i18n.html"
>Input internationalization</A
></DT
><DT
><A
HREF="using-terminal-server.html"
>Terminal Server or Fast User Switching</A
></DT
><DT
><A
HREF="using-customizing-traymenu.html"
>Customizing the notification area icon menu</A
></DT
></DL
></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="using-starting"
>Starting Cygwin/X</A
></H1
><P
>Described below are several methods of starting up the Cygwin/X X Server
with a startup utility that optionally starts initial clients (for example,
a terminal, a window manager, or a desktop environment) and performs
X server configuration (for example, loading a keyboard map).
</P
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="using-starting-exe"
>Starting in multiwindow mode (startxwin)</A
></H2
><P
>&#13;  The custom XWin startup utility <B
CLASS="command"
>startxwin</B
>
  <A
NAME="footnote-startxwin-differences"
HREF="#FTN.footnote-startxwin-differences"
><SPAN
CLASS="footnote"
>[1]</SPAN
></A
>
  starts the X server in multiwindow mode.
</P
><P
>&#13;<B
CLASS="command"
>startxwin</B
> is included in the <TT
CLASS="filename"
>xinit</TT
> package
(installed by following the instructions in <A
HREF="setup.html#setup-cygwin-x-installing"
>the Section called <I
>Installing Cygwin/X</I
> in Chapter 2</A
>).
</P
><P
>&#13;Run <B
CLASS="command"
>startxwin</B
> by:
<A
NAME="footnote-startxwin-not-recommended"
HREF="#FTN.footnote-startxwin-not-recommended"
><SPAN
CLASS="footnote"
>[2]</SPAN
></A
>
</P
><UL
><LI
><P
>&#13;using the "XWin Server" shortcut under "Cygwin-X" on the Start Menu
</P
></LI
><LI
><P
>&#13;Starting <TT
CLASS="filename"
>/usr/bin/startxwin</TT
> in a Cygwin shell:
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;$ startxwin
</PRE
></TD
></TR
></TABLE
></LI
></UL
><P
>&#13;You may create a <TT
CLASS="filename"
>~/.startxwinrc</TT
> script to customize the
client programs started, rather than using the default
<TT
CLASS="filename"
>/etc/X11/xinit/startxwinrc</TT
> script.
</P
><P
>&#13;Full documentation for <B
CLASS="command"
>startxwin</B
> can be read with
<A
HREF="http://x.cygwin.com/docs/man1/startxwin.1.html"
TARGET="_top"
>&#13;<B
CLASS="command"
>man startxwin</B
>
</A
>.
</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="using-starting-session"
>Starting an X desktop environment session or X window manager in windowed mode</A
></H2
><P
>&#13;    Several X desktop environments are packaged for Cygwin.
  </P
><UL
><LI
><P
>GNOME Flashback Desktop Environment: install the <TT
CLASS="filename"
>gnome-flashback</TT
> package</P
></LI
><LI
><P
>KDE Plasma Desktop Environment: install the <TT
CLASS="filename"
>kde-workspace</TT
> package</P
></LI
><LI
><P
>LXDE Desktop Environment: install the <TT
CLASS="filename"
>lxde-common</TT
> package</P
></LI
><LI
><P
>MATE Desktop Environment: install the <TT
CLASS="filename"
>mate-session-manager</TT
> package</P
></LI
><LI
><P
>Xfce Desktop Environment: install the <TT
CLASS="filename"
>xfce4-session</TT
> package</P
></LI
></UL
><P
>&#13;    and use the provided Start Menu shortcut.
    <A
NAME="footnote-cli-startx-session"
HREF="#FTN.footnote-cli-startx-session"
><SPAN
CLASS="footnote"
>[3]</SPAN
></A
>
  </P
><P
>&#13;    Several X window managers are packaged for Cygwin.
  </P
><UL
><LI
><P
>aewm++ window manager: install the <TT
CLASS="filename"
>aewm++</TT
> package</P
></LI
><LI
><P
>dwm window manager: install the <TT
CLASS="filename"
>dwm</TT
> package</P
></LI
><LI
><P
>FVWM window manager: install the <TT
CLASS="filename"
>fvwm</TT
> package</P
></LI
><LI
><P
>Openbox window manager: install the <TT
CLASS="filename"
>openbox</TT
> package</P
></LI
><LI
><P
>twm window manager: install the <TT
CLASS="filename"
>twm</TT
> package</P
></LI
><LI
><P
>WindowMaker window manager: install the <TT
CLASS="filename"
>WindowMaker</TT
> package</P
></LI
></UL
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="using-starting-xlaunch"
>Starting an X session with XLaunch</A
></H2
><P
>&#13;    XLaunch is a GUI wizard for starting the Cygwin/X X server and a local or
    remote X client.  These sessions can be saved and shared as
    <TT
CLASS="filename"
>.xlaunch</TT
> files.
  </P
><P
>&#13;    XLaunch is included in the <TT
CLASS="filename"
>xlaunch</TT
> package (installed by
    following the instructions in <A
HREF="setup.html#setup-cygwin-x-installing"
>the Section called <I
>Installing Cygwin/X</I
> in Chapter 2</A
>).
  </P
><P
>&#13;    Run <B
CLASS="command"
>xlaunch</B
> using the "XLaunch" shortcut under
    "Cygwin-X" on the Start Menu.
  </P
><P
>&#13;    Documentation for <B
CLASS="command"
>xlaunch</B
> is available at <A
HREF="http://x.cygwin.com/docs/xlaunch/"
TARGET="_top"
>http://x.cygwin.com/docs/xlaunch/</A
> and as online help within the
    program.
</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="using-starting-startx"
>Starting in windowed mode (startx)</A
></H2
><P
>Use the standard X Window System
<B
CLASS="command"
>startx</B
> command and its associated
<TT
CLASS="filename"
>~/.xinitrc</TT
> configuration file.
</P
><P
>&#13;Run <B
CLASS="command"
>startx</B
> in a Cygwin shell:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;$ startx
</PRE
></TD
></TR
></TABLE
><P
>&#13;Full documentation for <B
CLASS="command"
>startx</B
> can be read with
<A
HREF="http://www.x.org/releases/X11R7.5/doc/man/man1/startx.1.html"
TARGET="_top"
>&#13;<B
CLASS="command"
>man startx</B
>
</A
>.
</P
><P
>&#13;You may
create a <TT
CLASS="filename"
>~/.xinitrc</TT
> from the template in <TT
CLASS="filename"
>/etc/X11/xinit/xinitrc</TT
> and then customize
<TT
CLASS="filename"
>~/.xinitrc</TT
> to start client programs and configure
your X server.</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;$ cp /etc/X11/xinit/xinitrc ~/.xinitrc
[edit ~/.xinitrc as desired]
</PRE
></TD
></TR
></TABLE
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
<B
CLASS="command"
>startx</B
> waits until <TT
CLASS="filename"
>~/.xinitrc</TT
> exits
(which is often waiting for a window manager started by it to exit) and
then kills X, so the last client started by should be started
with <B
CLASS="command"
>exec</B
> and without <B
CLASS="command"
>&amp;</B
>.
</P
></BLOCKQUOTE
></DIV
><P
>&#13;Alternatively, if you just want to start a single client program (perhaps a window
manager), you don't need to use a <TT
CLASS="filename"
>~/.xinitrc</TT
>, and
can start the client directly from <B
CLASS="command"
>startx</B
>, e.g.
<A
NAME="footnote-startx-server-options"
HREF="#FTN.footnote-startx-server-options"
><SPAN
CLASS="footnote"
>[4]</SPAN
></A
>
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;$ startx /usr/bin/fvwm2
</PRE
></TD
></TR
></TABLE
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
The client name supplied to <B
CLASS="command"
>startx</B
> must begin with / or .,
otherwise it is treated as an option to the default <B
CLASS="command"
>xterm</B
> client.
</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="using-starting-advanced"
>Notes for advanced users</A
></H2
><P
>&#13;Advanced users may wish to start the X server by invoking <B
CLASS="command"
>XWin</B
> directly,
for example, to start XDMCP sessions (See <A
HREF="using-remote-session.html"
>the Section called <I
>Remote sessions via XDMCP</I
></A
>).
</P
><P
>&#13;If you want to have a Start Menu shortcut which runs <B
CLASS="command"
>startxwin</B
> with custom options, you should
use a copy of the Start Menu shortcut installed by <TT
CLASS="filename"
>xinit</TT
>, so that your
changes are not overwritten when the <TT
CLASS="filename"
>xinit</TT
> package is updated.
</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="using-starting-obsolete"
>Obsolete startup methods</A
></H2
><P
>&#13;The MS-DOS batch file <TT
CLASS="filename"
>startxwin.bat</TT
> and bash shell script <TT
CLASS="filename"
>startxwin.sh</TT
>
previously used to start the X server are no longer provided.  This implementation made it difficult
to reliably wait until the the X server had started before starting any clients.
Use <TT
CLASS="filename"
>startxwin</TT
> instead.
</P
><P
>&#13;The executable <TT
CLASS="filename"
>startxwin.exe</TT
> previously used to start the X
server has been retired and replaced with a shell script <B
CLASS="command"
>startxwin</B
>.
</P
></DIV
></DIV
></DIV
><H3
CLASS="FOOTNOTES"
>Notes</H3
><TABLE
BORDER="0"
CLASS="FOOTNOTES"
WIDTH="100%"
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.footnote-startxwin-differences"
HREF="using.html#footnote-startxwin-differences"
><SPAN
CLASS="footnote"
>[1]</SPAN
></A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>&#13;<B
CLASS="command"
>startxwin</B
> is a specialized version of <B
CLASS="command"
>startx</B
>
with a few differences appropriate to running in multiwindow mode, rather than windowed mode.
</P
><UL
><LI
><P
>&#13;<B
CLASS="command"
>startxwin</B
> supplies the <B
CLASS="command"
>-multiwindow</B
> option to
X
</P
></LI
><LI
><P
>&#13;It uses a different script to start clients (<TT
CLASS="filename"
>~/.startxwinrc</TT
>
rather than <TT
CLASS="filename"
>~/.xinitrc</TT
>), because <TT
CLASS="filename"
>~/.xinitrc</TT
>
will normally end by starting a window manager, which would be incorrect for
<TT
CLASS="filename"
> ~/.startxwinrc</TT
> (as it would discover the internal window manager
is already running and exit immediately).
</P
></LI
><LI
><P
>&#13;Note that <B
CLASS="command"
>startxwin</B
> <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>no longer</I
></SPAN
> exits after
<TT
CLASS="filename"
>~/.startxwinrc</TT
> has completed, leaving X
running, but, similar to <B
CLASS="command"
>startx</B
>, waits until
<TT
CLASS="filename"
>~/.startxwinrc</TT
> exits and then kills X.
</P
><P
>&#13;If you don't want the X server to exit until explicitly told to do so, end your
<TT
CLASS="filename"
>~/.startxwinrc</TT
> with something like <B
CLASS="command"
>exec sleep
infinity</B
>.
</P
></LI
></UL
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.footnote-startxwin-not-recommended"
HREF="using.html#footnote-startxwin-not-recommended"
><SPAN
CLASS="footnote"
>[2]</SPAN
></A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>&#13;It's not recommended to start <TT
CLASS="filename"
>startxwin</TT
> from a MS-DOS shell or by double-clicking it in
Windows Explorer.  To do so means that the X server is not started from a login shell, and programs started from
the notification area icon menu will not inherit the environment of a login shell.  This may lead to unexpected
behaviour, for example, if you have customizations to your login shell start-up scripts which set environment variables.
</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.footnote-cli-startx-session"
HREF="using.html#footnote-cli-startx-session"
><SPAN
CLASS="footnote"
>[3]</SPAN
></A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>&#13;        Alternatively, these sessions can be started from the command line, e.g.
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;startx /usr/bin/dbus-launch mate-session
</PRE
></TD
></TR
></TABLE
>
        or
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;echo "/usr/bin/dbus-launch startxfce4" &gt; ~/.xinitrc
</PRE
></TD
></TR
></TABLE
>
        and then running <B
CLASS="command"
>startx</B
>.
      </P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.footnote-startx-server-options"
HREF="using.html#footnote-startx-server-options"
><SPAN
CLASS="footnote"
>[4]</SPAN
></A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>&#13;Note that <B
CLASS="command"
>startxwin</B
> and <B
CLASS="command"
>startx</B
> use the
special option <TT
CLASS="filename"
>--</TT
> to mark the end of client options and the
beginning of server options, So, for example, if you wish to also start the X
server with the options <TT
CLASS="filename"
>-emulate3buttons</TT
> and
<TT
CLASS="filename"
>-noclipboard</TT
>, as described in <A
HREF="configure-cygwin-x-options.html"
>the Section called <I
>Command line parameters</I
> in Chapter 4</A
>, use the following command:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;$ startx /usr/bin/fvwm2 -- -emulate3buttons -noclipboard
</PRE
></TD
></TR
></TABLE
>
</P
></TD
></TR
></TABLE
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"/><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="setup.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cygwin-x-ug.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="using-local-apps.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Setting Up Cygwin/X</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Displaying local clients</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>